package com.galen.manual.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Min;
import javax.validation.constraints.Max;
import java.time.LocalDateTime;

@Data
@Schema(description = "Banner创建请求")
public class BannerCreateDTO {

    @NotBlank(message = "标题不能为空")
    @Schema(description = "标题", required = true)
    private String title;

    @NotBlank(message = "图片URL不能为空")
    @Schema(description = "图片URL", required = true)
    private String imageUrl;

    @Schema(description = "链接URL")
    private String linkUrl;

    @NotNull(message = "链接类型不能为空")
    @Min(value = 0, message = "链接类型值不正确")
    @Max(value = 2, message = "链接类型值不正确")
    @Schema(description = "链接类型 0:无链接 1:内部页面 2:外部链接", required = true)
    private Integer linkType = 0;

    @NotNull(message = "排序不能为空")
    @Min(value = 0, message = "排序值不能小于0")
    @Schema(description = "排序值", required = true)
    private Integer sortOrder = 0;

    @NotNull(message = "状态不能为空")
    @Min(value = 0, message = "状态值不正确")
    @Max(value = 1, message = "状态值不正确")
    @Schema(description = "状态 0:禁用 1:启用", required = true)
    private Integer status = 1;

    @Schema(description = "开始时间")
    private LocalDateTime startTime;

    @Schema(description = "结束时间")
    private LocalDateTime endTime;

    @Schema(description = "描述")
    private String description;
}